= render ::Layouts::SettingsBlockComponent.new(_('Service Desk'),
  button_options: { class: ('hidden' if @project.project_feature.send(:issues_access_level) == 0) },
  id: 'js-service-desk',
  testid: 'service-desk-content',
  expanded: expanded_by_default?) do |c|
  - c.with_description do
    - link_start = "<a href='#{help_page_path('user/project/service_desk/_index.md')}' target='_blank' rel='noopener noreferrer'>".html_safe
    = _('Enable and disable Service Desk. Some additional configuration might be required. %{link_start}Learn more%{link_end}.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
  - c.with_body do
    - if ::ServiceDesk.supported?
      - service_desk_enabled = ::ServiceDesk.enabled?(@project)
      - service_desk_emails = ::ServiceDesk::Emails.new(@project)

      -# Data attributes refactoring issue: https://gitlab.com/gitlab-org/gitlab/-/issues/467547
      .js-service-desk-setting-root{ data: { endpoint: project_service_desk_path(@project),
        enabled: "#{service_desk_enabled}",
        issue_tracker_enabled: "#{@project.project_feature.issues_enabled?}",
        incoming_email: (service_desk_emails.incoming_address if service_desk_enabled),
        service_desk_email: (service_desk_emails.alias_address if service_desk_enabled),
        service_desk_email_enabled: "#{Gitlab::Email::ServiceDeskEmail.enabled?}",
        selected_template: "#{@project.service_desk_setting&.issue_template_key}",
        selected_file_template_project_id: "#{@project.service_desk_setting&.file_template_project_id}",
        outgoing_name: "#{@project.service_desk_setting&.outgoing_name}",
        project_key: "#{@project.service_desk_setting&.project_key}",
        tickets_confidential_by_default: "#{@project.service_desk_setting.nil? ? true : @project.service_desk_setting&.tickets_confidential_by_default}",
        reopen_issue_on_external_participant_note: "#{@project.service_desk_setting&.reopen_issue_on_external_participant_note}",
        add_external_participants_from_cc: "#{@project.service_desk_setting&.add_external_participants_from_cc}",
        templates: available_service_desk_templates_for(@project),
        public_project: "#{@project.public?}",
        custom_email_endpoint: project_service_desk_custom_email_path(@project) } }
    - elsif show_callout?('promote_service_desk_dismissed')
      = render 'shared/promotions/promote_servicedesk'
